<?php
if (preg_match("/^[();[]{}]+$/", $_GET['url'])) {
  //Something bad
} else {
  $ctx = stream_context_create(array('http' => array('timeout' => 10)));
  $dec = rawurldecode($_GET['url']);
  if (!(@$contents = file_get_contents($dec, 0, $ctx))) {
    //fail
  } else {
    //success
    // This would be the production thing to do
    echo $contents;
    // Here, we append to the JSON data returned 
    /* 
       if ($contents[strlen($contents)-1] == ']') { 
         $tmp = substr($contents,0,-1).',{"_req":"'.$dec.'"}]'; 
       } else { 
         $tmp = substr($contents,0,-1).',"_req":"'.$dec.'"}'; 
       } 
       echo $tmp; 
    */
  }
}
?>
